package com.kun.server.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.kun.dao.CarDao;
import com.kun.entity.CarEntity;
import com.kun.server.CarServer;

@Service("CarServerImpl")
public class CarServerImpl implements CarServer {
	
	@Resource(name="CarDaoImpl")
	private CarDao carDao;

	public String addCar(CarEntity carEntity,int id) {
		carEntity.setCustomerid(id);
		return carDao.addCar(carEntity);
	}

	public List<CarEntity> getCarInfo(int id) {
		String hql = "from CarEntity where customerid = ?";
		
		return carDao.getCarInfo(hql, id);
	}

	public List<String> selCarIdById(int id) {
		String hql = "from CarEntity where customerid = ?";
		
		return carDao.selCarIdById(hql,id);
	}

	public List<CarEntity> getCarInfoByCarId(String carId) {
		String hql = "from CarEntity where carid = ?";
		
		return carDao.getCarInfoByCarId(hql,carId);
	}

}
